/**
 * 
 */
package com.guoxianwei.scm.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.guoxianwei.scm.domain.Employee;
import com.guoxianwei.scm.persistence.EmployeeMapper;

/**
 * @author guoxianwei
 *
 */
@Service
public class EmployeeService {

	@Autowired
	private EmployeeMapper employeeMapper;
	
	public List<Employee> searchEmployee(Map<String,Object> map) throws Exception{
		return employeeMapper.getEmployee(map);
	}
	
	public int searchEmployeeCount(Map<String,Object> map) throws Exception{
		return employeeMapper.getEmployeeCount(map);
	}
	public  Employee getEmployeeById(int id) throws Exception{
		return employeeMapper.getEmployeeById(id);
	}
	@Transactional
	public void insertEmployee(Employee paramEmployee){
		employeeMapper.insertEmployee(paramEmployee);
	}
	@Transactional
	public void removeEmployee(int id) throws Exception{
		employeeMapper.removeEmployee(id);
	}
}
